package cn.tedu.role.pojo.vo;

import cn.tedu.role.pojo.entity.Manager;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@TableName("role")
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class RoleVO {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id")
    private Integer id;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("权限组")
    private String rules;

    @ApiModelProperty("状态")
    private String status;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyy-MM-dd HH:mm:ss", timezone = "Ashia/Shanghai")
    private Date createTime;

    @ApiModelProperty("角色下管理员")
    private List<Manager> managers = new ArrayList<>();

    @ApiModelProperty("角色下管理员数量")
    private Integer managerCount = 0;
}
